package com.gz.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gz.utils.DataFmtUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * (Grade)实体参数类
 *
 * @author makejava
 * @since 2024-01-29 15:07:24
 */
@Data
@ApiModel("Grade实体参数类")
public class GradeDto extends PageInfoDto implements Serializable {

  private static final long serialVersionUID = 533371621220246144L;
  private Integer id;
  @ApiModelProperty("年级")
  private String value;
  @ApiModelProperty("创建人id")
  private Integer crtId;
  @ApiModelProperty("创建时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date crtDt;
  @ApiModelProperty("更新人id")
  private Integer optId;
  @ApiModelProperty("更新时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date optDt;
  @ApiModelProperty("排序字段")
  private String orderField;
  @ApiModelProperty("排序类型")
  private String orderType;

  public String getOrderField() {
    if (!StringUtils.isEmpty(orderField)) {
      return DataFmtUtil.xX2x_x(orderField);
    }
    return orderField;
  }
}

